package com.entity;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

public class User {
	private String id;
	@NotNull
	//长度设置
	@Size(min=2,max=15)
	private String name;
	@NotNull
	//数字大小限制
    @Min(18)
	private String age;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAge() {
		return age;
	}
	public void setAge(String age) {
		this.age = age;
	}
	public User(){}
	
	public User(String id, String name, String age) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
	}
	public String toString() {
        return "User(ID:"+this.id+"Name: " + this.name + ", Age: " + this.age + ")";
    }
}
